package com.icangya.domain;


import javax.persistence.*;
import java.sql.Timestamp;
import java.time.LocalDateTime;

@Entity
@Table(name = "proxy_level")
public class ProxyLevel {//记录代理用户数量

    private  long id;
    private  long uid;
    private  String openId;//用户微信id
    private Long firstLevel;//一级代理
    private Long secondLevel;//二级代理
    private Long thirdLevel;//三级代理
    private Long fourthLevel;//四级代理
    private Long fiveLevel;//五级代理
    private Long sixLevel;//六级代理

    private Timestamp createTime;//创建时间
    private Timestamp modifiedTime;//更改时间

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "openid")
    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    @Basic
    @Column(name = "uid")
    public long getUid() {
        return uid;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }

    @Basic
    @Column(name = "first_level")
    public Long getFirstLevel() {
        return firstLevel;
    }

    public void setFirstLevel(Long firstLevel) {
        this.firstLevel = firstLevel;
    }

    @Basic
    @Column(name = "second_level")
    public Long getSecondLevel() {
        return secondLevel;
    }

    public void setSecondLevel(Long secondLevel) {
        this.secondLevel = secondLevel;
    }

    @Basic
    @Column(name = "third_level")
    public Long getThirdLevel() {
        return thirdLevel;
    }

    public void setThirdLevel(Long thirdLevel) {
        this.thirdLevel = thirdLevel;
    }

    @Basic
    @Column(name = "fourth_level")
    public Long getFourthLevel() {
        return fourthLevel;
    }

    public void setFourthLevel(Long fourthLevel) {
        this.fourthLevel = fourthLevel;
    }
    @Basic
    @Column(name = "five_level")
    public Long getFiveLevel() {
        return fiveLevel;
    }

    public void setFiveLevel(Long fiveLevel) {
        this.fiveLevel = fiveLevel;
    }
    @Basic
    @Column(name = "six_level")
    public Long getSixLevel() {
        return sixLevel;
    }

    public void setSixLevel(Long sixLevel) {
        this.sixLevel = sixLevel;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "modified_time")
    public Timestamp getModifiedTime() {
        return modifiedTime;
    }

    public void setModifiedTime(Timestamp modifiedTime) {
        this.modifiedTime = modifiedTime;
    }

    public ProxyLevel(long uid, String openId, Long firstLevel, Long secondLevel, Long thirdLevel, Long fourthLevel, Long fiveLevel, Long sixLevel) {
        Timestamp now = Timestamp.valueOf(LocalDateTime.now());
        this.uid = uid;
        this.openId = openId;
        this.firstLevel = firstLevel;
        this.secondLevel = secondLevel;
        this.thirdLevel = thirdLevel;
        this.fourthLevel = fourthLevel;
        this.fiveLevel = fiveLevel;
        this.sixLevel = sixLevel;
        this.createTime = now;
        this.modifiedTime = now;
    }

    public ProxyLevel(Long uid, Long firstLevel, Long secondLevel, Long thirdLevel, Long fourthLevel) {
        Timestamp now = Timestamp.valueOf(LocalDateTime.now());
        this.uid = uid;
        this.firstLevel = firstLevel;
        this.secondLevel = secondLevel;
        this.thirdLevel = thirdLevel;
        this.fourthLevel = fourthLevel;
        this.createTime = now;
        this.modifiedTime = now;
    }

    public ProxyLevel() {
    }
}
